function TbCardBinding(params){ 
	 
}

TbCardBinding.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new TbCardBinding.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new TbCardBinding.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new TbCardBinding.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.tbcbId=function(tbcbId){if(this.proxy)return this.getProxy().tbcbId(tbcbId);  this.put("tbcbId", tbcbId);return this;};
	/** and tbcb_id is null */
	this.tbcbIdNull=function(){if(this.proxy)return this.getProxy().tbcbIdNull();if(this.get("tbcbIdNot")==null)this.put("tbcbIdNot", "");this.put("tbcbId", null);return this;};
	/** not .... */
	this.tbcbIdNot=function(){if(this.proxy)return this.getProxy().tbcbIdNot();this.put("tbcbIdNot", "not");return this;};
	this.tbcbIdNotNull=function(){if(this.proxy)return this.getProxy().tbcbIdNotNull();this.put("tbcbIdNot", "not");this.put("tbcbId", null);return this;};
	this.tbcbIdNot=function(tbcbId){if(this.proxy)return this.getProxy().tbcbIdNot(tbcbId);this.put("tbcbIdNot", "not");this.put("tbcbId", tbcbId);return this;};
	/** and tbcb_id <= ? */
	this.tbcbIdMin=function(min){if(this.proxy)return this.getProxy().tbcbIdMin(min);this.put("tbcbIdMin", min);return this;};
	/** and tbcb_id >= ? */
	this.tbcbIdMax=function(max){if(this.proxy)return this.getProxy().tbcbIdMax(max);this.put("tbcbIdMax", max);return this;};
	this.tbcbIdIn=function(ids){
		if(this.proxy)return this.getProxy().tbcbIdIn(ids);  this.put("tbcbIdIn", ids);return this;
	};	
	
	/** 品牌  [Merchant]      **/
	this.tbcbBrand=function(tbcbBrand){if(this.proxy)return this.getProxy().tbcbBrand(tbcbBrand);  this.put("tbcbBrand", tbcbBrand);return this;};
	/** and tbcb_brand is null */
	this.tbcbBrandNull=function(){if(this.proxy)return this.getProxy().tbcbBrandNull();if(this.get("tbcbBrandNot")==null)this.put("tbcbBrandNot", "");this.put("tbcbBrand", null);return this;};
	/** not .... */
	this.tbcbBrandNot=function(){if(this.proxy)return this.getProxy().tbcbBrandNot();this.put("tbcbBrandNot", "not");return this;};
	this.tbcbBrandNotNull=function(){if(this.proxy)return this.getProxy().tbcbBrandNotNull();this.put("tbcbBrandNot", "not");this.put("tbcbBrand", null);return this;};
	this.tbcbBrandNot=function(tbcbBrand){if(this.proxy)return this.getProxy().tbcbBrandNot(tbcbBrand);this.put("tbcbBrandNot", "not");this.put("tbcbBrand", tbcbBrand);return this;};
	this.tbcbBrandIn=function(ids){
		if(this.proxy)return this.getProxy().tbcbBrandIn(ids);  this.put("tbcbBrandIn", ids);return this;
	};	
	
	/** 线下代理卡        **/
	this.tbcbCard=function(tbcbCard){if(this.proxy)return this.getProxy().tbcbCard(tbcbCard);  this.put("tbcbCard", tbcbCard);return this;};
	/** and tbcb_card is null */
	this.tbcbCardNull=function(){if(this.proxy)return this.getProxy().tbcbCardNull();if(this.get("tbcbCardNot")==null)this.put("tbcbCardNot", "");this.put("tbcbCard", null);return this;};
	/** not .... */
	this.tbcbCardNot=function(){if(this.proxy)return this.getProxy().tbcbCardNot();this.put("tbcbCardNot", "not");return this;};
	this.tbcbCardNotNull=function(){if(this.proxy)return this.getProxy().tbcbCardNotNull();this.put("tbcbCardNot", "not");this.put("tbcbCard", null);return this;};
	this.tbcbCardNot=function(tbcbCard){if(this.proxy)return this.getProxy().tbcbCardNot(tbcbCard);this.put("tbcbCardNot", "not");this.put("tbcbCard", tbcbCard);return this;};
	/** and tbcb_card <= ? */
	this.tbcbCardMin=function(min){if(this.proxy)return this.getProxy().tbcbCardMin(min);this.put("tbcbCardMin", min);return this;};
	/** and tbcb_card >= ? */
	this.tbcbCardMax=function(max){if(this.proxy)return this.getProxy().tbcbCardMax(max);this.put("tbcbCardMax", max);return this;};
	this.tbcbCardIn=function(ids){
		if(this.proxy)return this.getProxy().tbcbCardIn(ids);  this.put("tbcbCardIn", ids);return this;
	};	
	
	/** 绑定用户        **/
	this.tbcbBindUser=function(tbcbBindUser){if(this.proxy)return this.getProxy().tbcbBindUser(tbcbBindUser);  this.put("tbcbBindUser", tbcbBindUser);return this;};
	/** and tbcb_bind_user is null */
	this.tbcbBindUserNull=function(){if(this.proxy)return this.getProxy().tbcbBindUserNull();if(this.get("tbcbBindUserNot")==null)this.put("tbcbBindUserNot", "");this.put("tbcbBindUser", null);return this;};
	/** not .... */
	this.tbcbBindUserNot=function(){if(this.proxy)return this.getProxy().tbcbBindUserNot();this.put("tbcbBindUserNot", "not");return this;};
	this.tbcbBindUserNotNull=function(){if(this.proxy)return this.getProxy().tbcbBindUserNotNull();this.put("tbcbBindUserNot", "not");this.put("tbcbBindUser", null);return this;};
	this.tbcbBindUserNot=function(tbcbBindUser){if(this.proxy)return this.getProxy().tbcbBindUserNot(tbcbBindUser);this.put("tbcbBindUserNot", "not");this.put("tbcbBindUser", tbcbBindUser);return this;};
	/** and tbcb_bind_user <= ? */
	this.tbcbBindUserMin=function(min){if(this.proxy)return this.getProxy().tbcbBindUserMin(min);this.put("tbcbBindUserMin", min);return this;};
	/** and tbcb_bind_user >= ? */
	this.tbcbBindUserMax=function(max){if(this.proxy)return this.getProxy().tbcbBindUserMax(max);this.put("tbcbBindUserMax", max);return this;};
	this.tbcbBindUserIn=function(ids){
		if(this.proxy)return this.getProxy().tbcbBindUserIn(ids);  this.put("tbcbBindUserIn", ids);return this;
	};	
	
	/** 充值码        **/
	this.tbcbReCode=function(tbcbReCode){if(this.proxy)return this.getProxy().tbcbReCode(tbcbReCode);  this.put("tbcbReCode", tbcbReCode);return this;};
	/** and tbcb_re_code is null */
	this.tbcbReCodeNull=function(){if(this.proxy)return this.getProxy().tbcbReCodeNull();if(this.get("tbcbReCodeNot")==null)this.put("tbcbReCodeNot", "");this.put("tbcbReCode", null);return this;};
	/** not .... */
	this.tbcbReCodeNot=function(){if(this.proxy)return this.getProxy().tbcbReCodeNot();this.put("tbcbReCodeNot", "not");return this;};
	this.tbcbReCodeNotNull=function(){if(this.proxy)return this.getProxy().tbcbReCodeNotNull();this.put("tbcbReCodeNot", "not");this.put("tbcbReCode", null);return this;};
	this.tbcbReCodeNot=function(tbcbReCode){if(this.proxy)return this.getProxy().tbcbReCodeNot(tbcbReCode);this.put("tbcbReCodeNot", "not");this.put("tbcbReCode", tbcbReCode);return this;};
	
	/** 二维码        **/
	this.tbcbQrCode=function(tbcbQrCode){if(this.proxy)return this.getProxy().tbcbQrCode(tbcbQrCode);  this.put("tbcbQrCode", tbcbQrCode);return this;};
	/** and tbcb_qr_code is null */
	this.tbcbQrCodeNull=function(){if(this.proxy)return this.getProxy().tbcbQrCodeNull();if(this.get("tbcbQrCodeNot")==null)this.put("tbcbQrCodeNot", "");this.put("tbcbQrCode", null);return this;};
	/** not .... */
	this.tbcbQrCodeNot=function(){if(this.proxy)return this.getProxy().tbcbQrCodeNot();this.put("tbcbQrCodeNot", "not");return this;};
	this.tbcbQrCodeNotNull=function(){if(this.proxy)return this.getProxy().tbcbQrCodeNotNull();this.put("tbcbQrCodeNot", "not");this.put("tbcbQrCode", null);return this;};
	this.tbcbQrCodeNot=function(tbcbQrCode){if(this.proxy)return this.getProxy().tbcbQrCodeNot(tbcbQrCode);this.put("tbcbQrCodeNot", "not");this.put("tbcbQrCode", tbcbQrCode);return this;};
	
	/** 绑定状态    0:未绑定 1:已绑定     **/
	this.tbcbBindState=function(tbcbBindState){if(this.proxy)return this.getProxy().tbcbBindState(tbcbBindState);  this.put("tbcbBindState", tbcbBindState);return this;};
	/** and tbcb_bind_state is null */
	this.tbcbBindStateNull=function(){if(this.proxy)return this.getProxy().tbcbBindStateNull();if(this.get("tbcbBindStateNot")==null)this.put("tbcbBindStateNot", "");this.put("tbcbBindState", null);return this;};
	/** not .... */
	this.tbcbBindStateNot=function(){if(this.proxy)return this.getProxy().tbcbBindStateNot();this.put("tbcbBindStateNot", "not");return this;};
	this.tbcbBindStateNotNull=function(){if(this.proxy)return this.getProxy().tbcbBindStateNotNull();this.put("tbcbBindStateNot", "not");this.put("tbcbBindState", null);return this;};
	this.tbcbBindStateNot=function(tbcbBindState){if(this.proxy)return this.getProxy().tbcbBindStateNot(tbcbBindState);this.put("tbcbBindStateNot", "not");this.put("tbcbBindState", tbcbBindState);return this;};
	this.tbcbBindStateIn=function(ids){
		if(this.proxy)return this.getProxy().tbcbBindStateIn(ids);  this.put("tbcbBindStateIn", ids);return this;
	};	
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有线下代理卡绑定 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/agents/tbcardbinding.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取线下代理卡绑定分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/agents/tbcardbinding.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取线下代理卡绑定 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/agents/tbcardbinding.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

TbCardBinding.get = function(id){
	var protocol = ux.ajax("/admin/agents/tbcardbinding.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.tbCardBinding;
	return null;
}

TbCardBinding.where = new TbCardBinding.Where(0,true);